#pragma once

#include	<Net.h>
#include	<SQL.h>
#include	<Singleton.h>

/**
 * Service of Zone server.
 */
class ZoneService : public IBaseService, public ISingleton<ZoneService> {
public:
	ZoneService() : IBaseService("zone"), _queue(32) {}
	virtual ~ZoneService() {}

	/**
	 * Implement message processor.
	 *
	 * \param	sender	Client.
	 * \param	msg		Received message.
	 */
	virtual void OnReceive(Sender * sender, Protocol * msg) override;

	/**
	 * Connect to database.
	 *
	 * \param	conf	Configuration file to read MySQL settings.
	 * \return Connect result.
	 */
	bool Initialize(class IniFile & conf);

private:
	SQL::Pool _queue;
};